package com.chennan.pattern.chain.actual;

import java.util.Objects;

/**
 * @author chennan
 * @createTime 2022年02月25日 10:05:00
 */
public enum CustomerJudgeEnum {

    EXIST_ACCOUNT_ORG_BACK(0, "组织机构存在对应银行渠道开户成功的平台商"),
    NOT_EXIST_ACCOUNT_ORG_BACK(1, "组织机构不存在对应银行渠道开户成功的平台商"),
    EXIST_ACCOUNT_CUSTONER(2, "组织机构存在对应银行渠道开户成功的业务商"),
    NOT_EXIST_ACCOUNT_CUSTONER(3, "组织机构不存在对应银行渠道开户成功的业务商"),
//    NOT_EXIST_ACCOUNT_CUSTONER(4, ""),

    ;

    private Integer code;

    private String text;

    CustomerJudgeEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public static String findTextByCode(Integer code) {
        if (Objects.isNull(code)) {
            return null;
        }
        for (CustomerJudgeEnum e : CustomerJudgeEnum.values()) {
            if (Objects.equals(e.getCode(), code)) {
                return e.getText();

            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
